package com.sanyang.lawyer.controller.adm;

import com.sanyang.lawyer.entity.Adm_Complain;
import com.sanyang.lawyer.service.adm.AdmComplainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @program: lawyer
 * @description: 投诉Controller层
 * @author: Mr.Wang
 * @create: 2019-10-30 08:41
 **/
@RestController
@RequestMapping("complain")
public class AdmComplainController {

        @Autowired
        private AdmComplainService complainService;

        @RequestMapping("listall")
        public List<Adm_Complain> listall(){
            return complainService.list();
        }

        @RequestMapping("furry")
        public List<Adm_Complain> furry(String cname,String kdate,String jdate){
            Map<String,String> map=new HashMap<String, String>();
            if(cname!=""&&cname!=null){
                map.put("cname",cname);
            }
            if(kdate!=""&&kdate!=null){
                map.put("kdate",kdate);
            }
            if(jdate!=""&&jdate!=null){
                map.put("jdate",jdate);
            }
            List<Adm_Complain> list=complainService.furry(map);
            return list;
        }


}
